#!/usr/bin/perl
# 
# Exercise 10.3
# 
# Write a subroutine that passes a hash by value. Now rewrite it to pass the hash by 
# reference.
#

use strict;
use warnings;

my %a_hash = (
'1' => 'one',
'2' => 'two',
'3' => 'three',
'4' => 'four',
);

print getone_by_value(%a_hash), "\n";

print getone_by_reference(\%a_hash), "\n";


sub getone_by_value {
	my(%hash) = @_;

	return $hash{'1'};
}

sub getone_by_reference {
	my($hash) = @_;

	return $$hash{'1'};
}
